//
// Created by Kai Wang on 2023/12/27.
//
#include "item/item_category.h"

namespace Convert
{
void StringToItemCategory(const std::string &pStr, ItemCategory &pVal)
{
    if(pStr == "ALL")
    {
        pVal = ItemCategory::ALL;
    }
    else if(pStr == "SOUP")
    {
        pVal = ItemCategory::SOUP;
    }
    else if(pStr == "NOODLES")
    {
        pVal = ItemCategory::NOODLES;
    }
    else if(pStr == "DISHES")
    {
        pVal = ItemCategory::DISHES;
    }
    else if(pStr == "MAIN")
    {
        pVal = ItemCategory::MAIN;
    }
    else if(pStr == "DRINKS")
    {
        pVal = ItemCategory::DRINKS;
    }
    else
    {
        pVal = ItemCategory::INVALID;
    }
}

void ItemCategoryToString(const ItemCategory &pVal, std::string &pStr)
{
    switch(pVal)
    {
    case ItemCategory::ALL:
        pStr = "ALL";
        break;
    case ItemCategory::SOUP:
        pStr = "SOUP";
        break;
    case ItemCategory::NOODLES:
        pStr = "NOODLES";
        break;
    case ItemCategory::DISHES:
        pStr = "DISHES";
        break;
    case ItemCategory::MAIN:
        pStr = "MAIN";
        break;
    case ItemCategory::DRINKS:
        pStr = "DRINKS";
        break;
    default:
        pStr = "INVALID";
        break;
    }
}

std::string ItemCategoryToString(const ItemCategory &pVal)
{
    std::string pStr;
    switch(pVal)
    {
    case ItemCategory::ALL:
        pStr = "ALL";
        break;
    case ItemCategory::SOUP:
        pStr = "SOUP";
        break;
    case ItemCategory::NOODLES:
        pStr = "NOODLES";
        break;
    case ItemCategory::DISHES:
        pStr = "DISHES";
        break;
    case ItemCategory::MAIN:
        pStr = "MAIN";
        break;
    case ItemCategory::DRINKS:
        pStr = "DRINKS";
        break;
    default:
        pStr = "INVALID";
        break;
    }
    return pStr;
}
}  // namespace Convert
